package pacman.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Clock {
    private static long timer;
    private static long publicTimer;
    private static SimpleDateFormat sdf;
    public Clock() {
		timer = 0;
		publicTimer = 0;
		sdf = new SimpleDateFormat("mm:ss");
    }

    public void update(int delta) {
		timer += delta;
		if (timer >= 1000) {
		    publicTimer++;
		    timer = 0;
		}
    }
    
    public static String getTime() {
    	return sdf.format(new Date(publicTimer * 1000));
    }
    
    public static long getTimer() {
    	return publicTimer;
    }
}
